
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>logback中文网|第十三章：从 log4j 迁移</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="logback中文网包含了logback中文文档，最新资讯，应用案例等。logback 继承自 log4j，它建立在有十年工业经验的日志系统之上。它比其它所有的日志系统更快并且更小，包含了许多独特并且有用的特性。"><meta name="keywords" content="logback中文文档, logback api文档, logback log4j,springboot logback,logback日志类型">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="14第十四章Receivers.html" />
    
    
    <link rel="prev" href="12第十二章Groovy配置.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01第一章logback介绍.html">
            
                <a href="01第一章logback介绍.html">
            
                    
                    第一章：logback 介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="02第二章架构.html">
            
                <a href="02第二章架构.html">
            
                    
                    第二章：架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="03第三章logback的配置.html">
            
                <a href="03第三章logback的配置.html">
            
                    
                    第三章：logback 的配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="04第四章Appenders.html">
            
                <a href="04第四章Appenders.html">
            
                    
                    第四章：Appenders
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="05第五章Encoder.html">
            
                <a href="05第五章Encoder.html">
            
                    
                    第五章：Encoder
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="06第六章Layouts.html">
            
                <a href="06第六章Layouts.html">
            
                    
                    第六章：Layouts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="07第七章Filters.html">
            
                <a href="07第七章Filters.html">
            
                    
                    第七章：Filters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="08第八章MDC.html">
            
                <a href="08第八章MDC.html">
            
                    
                    第八章：MDC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="09第九章日志隔离.html">
            
                <a href="09第九章日志隔离.html">
            
                    
                    第九章：日志隔离
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="10第十章JMX配置器.html">
            
                <a href="10第十章JMX配置器.html">
            
                    
                    第十章：JMX 配置器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="11第十一章Joran.html">
            
                <a href="11第十一章Joran.html">
            
                    
                    第十一章：Joran
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="12第十二章Groovy配置.html">
            
                <a href="12第十二章Groovy配置.html">
            
                    
                    第十二章：Groovy 配置
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.14" data-path="13第十三章从log4j迁移.html">
            
                <a href="13第十三章从log4j迁移.html">
            
                    
                    第十三章：从 log4j 迁移
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="14第十四章Receivers.html">
            
                <a href="14第十四章Receivers.html">
            
                    
                    第十四章：Receivers
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="15第十五章使用SSL.html">
            
                <a href="15第十五章使用SSL.html">
            
                    
                    第十五章：使用 SSL
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第十三章：从 log4j 迁移</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x672C;&#x7AE0;&#x6D89;&#x53CA;&#x5230;&#x7684;&#x5185;&#x5BB9;&#x4E3A;&#x5C06; log4j &#x7684;&#x7EC4;&#x4EF6;&#xFF0C;&#x4F8B;&#x5982; appender &#x6216;&#x8005; layout &#x8FC1;&#x79FB;&#x5230; logback-classic&#x3002;</p>
<p>&#x4EC5;&#x4EC5;&#x8C03;&#x7528; log4j &#x5BA2;&#x6237;&#x7AEF; API &#x7684;&#x8F6F;&#x4EF6;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;  <code>org.apache.log4j</code> &#x5305;&#x4E2D; <code>Logger</code> &#x6216;&#x8005; <code>Category</code> &#x7C7B;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <a href="https://www.slf4j.org/migrator.html" target="_blank">SLF4J &#x8FC1;&#x79FB;&#x5DE5;&#x5177;</a>&#x4F7F;&#x7528; SLF4J &#x6765;&#x8FDB;&#x884C;&#x81EA;&#x52A8;&#x8FC1;&#x79FB;&#x3002;&#x4E3A;&#x4E86;&#x5C06; <em>log4j.property</em> &#x6587;&#x4EF6;&#x8F6C;&#x6362;&#x4E3A;&#x540C;&#x7B49;&#x7684; logback &#x914D;&#x7F6E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <a href="https://logback.qos.ch/translator/" target="_blank">log4j.properties &#x8F6C;&#x6362;&#x5668;</a>&#x3002;</p>
<p>&#x5728;&#x67D0;&#x79CD;&#x7A0B;&#x5EA6;&#x4E0A;&#x6765;&#x8BF4;&#xFF0C;log4j &#x4E0E; logback-classic &#x5BC6;&#x5207;&#x76F8;&#x5173;&#x3002;&#x6838;&#x5FC3;&#x7EC4;&#x4EF6;&#xFF0C;logger&#xFF0C;appender &#x4EE5;&#x53CA; layout &#x5728;&#x4E24;&#x4E2A;&#x6846;&#x67B6;&#x4E2D;&#x90FD;&#x5B58;&#x5728;&#xFF0C;&#x5E76;&#x4E14;&#x76EE;&#x7684;&#x4E00;&#x81F4;&#x3002;&#x7C7B;&#x4F3C;&#x7684;&#xFF0C;&#x6700;&#x91CD;&#x8981;&#x7684;&#x5185;&#x90E8;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x53EB;&#x505A; <code>LoggingEvent</code>&#xFF0C;&#x5728;&#x4E24;&#x4E2A;&#x6846;&#x67B6;&#x4E2D;&#x975E;&#x5E38;&#x76F8;&#x4F3C;&#xFF0C;&#x4F46;&#x662F;&#x5B9E;&#x73B0;&#x5B8C;&#x5168;&#x4E0D;&#x540C;&#x3002;&#x6700;&#x4E3B;&#x8981;&#x7684;&#x662F;&#xFF0C;&#x5728; logback-classic &#x4E2D;&#xFF0C;<code>LoggingEvent</code> &#x5B9E;&#x73B0;&#x4E86; <code>ILoggingEvent</code> &#x63A5;&#x53E3;&#x3002;&#x8FC1;&#x79FB; log4j &#x7EC4;&#x4EF6;&#x5230; logback-classic &#x6700;&#x5927;&#x7684;&#x6539;&#x53D8;&#x5728;&#x4E8E; <code>LoggingEvent</code> &#x7C7B;&#x76F8;&#x5173;&#x7684;&#x5B9E;&#x73B0;&#x4E0D;&#x540C;&#x3002;&#x4F46;&#x662F;&#xFF0C;&#x8BF7;&#x653E;&#x5FC3;&#xFF0C;&#x8FD9;&#x4E9B;&#x53D8;&#x5316;&#x662F;&#x6709;&#x9650;&#x7684;&#x3002;&#x5982;&#x679C;&#x4F60;&#x5C3D;&#x4E86;&#x6700;&#x5927;&#x7684;&#x52AA;&#x529B;&#x4ECD;&#x7136;&#x4E0D;&#x80FD;&#x5C06; log4j &#x7EC4;&#x4EF6;&#x8FC1;&#x79FB;&#x5230; logback-classic&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <a href="https://logback.qos.ch/mailinglist.html" target="_blank">logback &#x5F00;&#x53D1;&#x90AE;&#x4EF6;&#x5217;&#x8868;</a>&#x6765;&#x8FDB;&#x884C;&#x63D0;&#x95EE;&#x3002;logback &#x7684;&#x5F00;&#x53D1;&#x8005;&#x5E94;&#x8BE5;&#x53EF;&#x4EE5;&#x63D0;&#x4F9B;&#x6307;&#x5BFC;&#x3002;</p>
<h3 id="&#x8FC1;&#x79FB;-log4j-&#x7684;-layout">&#x8FC1;&#x79FB; log4j &#x7684; layout</h3>
<p>&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x73B0;&#x5728;&#x8981;&#x8FC1;&#x79FB;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#xFF0C;&#x540D;&#x53EB; <a href="https://logback.qos.ch/xref/chapters/migrationFromLog4j/TrivialLog4jLayout.html" target="_blank">TrivialLog4jLayout</a> &#x7684; log4j layout&#xFF0C;&#x5B83;&#x5C06;&#x65E5;&#x5FD7;&#x4E8B;&#x4EF6;&#x4E2D;&#x7684;&#x6D88;&#x606F;&#x4F5C;&#x4E3A;&#x683C;&#x5F0F;&#x5316;&#x6D88;&#x606F;&#x8FD4;&#x56DE;&#x3002;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> chapters.migrationFromLog4j;

<span class="hljs-keyword">import</span> org.apache.log4j.Layout;
<span class="hljs-keyword">import</span> org.apache.log4j.spi.LoggingEvent;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TrivialLog4jLayout</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Layout</span> </span>{

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">activateOptions</span><span class="hljs-params">()</span> </span>{

  }

  <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">format</span><span class="hljs-params">(LoggingEvent loggingEvent)</span> </span>{
    <span class="hljs-keyword">return</span> loggingEvent.getRenderedMessage();
  }

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">ignoresThrowable</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
  }
}
</code></pre>
<p>&#x7B49;&#x4EF7;&#x7684; logback-classic <a href="https://logback.qos.ch/xref/chapters/migrationFromLog4j/TrivialLogbackLayout.html" target="_blank">TrivialLogbackLayout</a> &#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> chapters.migrationFromLog4j;

<span class="hljs-keyword">import</span> ch.qos.logback.classic.spi.ILoggingEvent;
<span class="hljs-keyword">import</span> ch.qos.logback.core.LayoutBase;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TrivialLogbackLayout</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">LayoutBase</span>&lt;<span class="hljs-title">ILoggingEvent</span>&gt; </span>{

  <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">doLayout</span><span class="hljs-params">(ILoggingEvent loggingEvent)</span> </span>{
    <span class="hljs-keyword">return</span> loggingEvent.getMessage();
  }
}
</code></pre>
<p>&#x6B63;&#x5982;&#x4F60;&#x6240;&#x89C1;&#xFF0C;&#x5728; logback-classic layout &#x4E2D;&#xFF0C;&#x683C;&#x5F0F;&#x5316;&#x7684;&#x65B9;&#x6CD5;&#x53EB;&#x505A; <code>doLayout</code>&#xFF0C;&#x800C;&#x5728; log4j &#x4E2D;&#x53EB; <code>format()</code>&#x3002;&#x56E0;&#x4E3A;&#x5728; logback-classic &#x4E2D;&#x6CA1;&#x6709;&#x7B49;&#x4EF7;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x6240;&#x4EE5; <code>ignoresThrowable()</code> &#x65B9;&#x6CD5;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x3002;logback-classic layout &#x5FC5;&#x987B;&#x7EE7;&#x627F; <code>LayoutBase&lt;ILoggingEvent&gt;</code>  &#x7C7B;&#x3002;</p>
<p><code>activateOptions()</code> &#x65B9;&#x6CD5;&#x7684;&#x4F18;&#x70B9;&#x503C;&#x5F97;&#x8FDB;&#x4E00;&#x6B65;&#x8BA8;&#x8BBA;&#x3002;&#x5728; log4j &#x4E2D;&#xFF0C;&#x4E00;&#x4E2A; layout &#x6709;&#x5B83;&#x81EA;&#x5DF1;&#x7684; <code>activateOptions()</code> &#x65B9;&#x6CD5;&#xFF0C;&#x901A;&#x8FC7; log4j &#x7684;&#x914D;&#x7F6E;&#x7A0B;&#x5E8F;&#xFF0C;&#x4E5F;&#x5C31;&#x662F; <code>PropertyConfigurator</code> &#x4E0E; <code>DOMConfigurator</code>&#xFF0C;&#x4F1A;&#x5728; layout &#x6240;&#x6709;&#x7684;&#x9009;&#x9879;&#x90FD;&#x8BBE;&#x7F6E;&#x5B8C;&#x4E4B;&#x540E;&#x8C03;&#x7528;&#x3002;&#x56E0;&#x6B64;&#xFF0C;layout &#x6709;&#x673A;&#x4F1A;&#x53BB;&#x68C0;&#x67E5;&#x5B83;&#x7684;&#x6240;&#x6709;&#x7684;&#x9009;&#x9879;&#x662F;&#x5426;&#x4E00;&#x81F4;&#xFF0C;&#x5982;&#x679C;&#x662F;&#xFF0C;&#x90A3;&#x4E48;&#x5F00;&#x59CB;&#x8FDB;&#x884C;&#x521D;&#x59CB;&#x5316;&#x3002;</p>
<p>&#x5728; logback-classic &#x4E2D;&#xFF0C;layout &#x5FC5;&#x987B;&#x5B9E;&#x73B0; <a href="https://logback.qos.ch/xref/ch/qos/logback/core/spi/LifeCycle.html" target="_blank">LifeCycle</a> &#x63A5;&#x53E3;&#xFF0C;&#x8BE5;&#x63A5;&#x53E3;&#x5305;&#x542B;&#x4E86;&#x4E00;&#x4E2A; <code>start()</code> &#x65B9;&#x6CD5;&#x3002;&#x8FD9;&#x4E2A; <code>start()</code> &#x65B9;&#x6CD5;&#x76F8;&#x5F53; log4j &#x4E2D;&#x7684; <code>activateOptions()</code> &#x65B9;&#x6CD5;&#x3002;</p>
<h3 id="&#x8FC1;&#x79FB;-log4j-&#x7684;-appender">&#x8FC1;&#x79FB; log4j &#x7684; appender</h3>
<p>&#x8FC1;&#x79FB; appender &#x4E0E;&#x8FC1;&#x79FB; layout &#x76F8;&#x5F53;&#x7684;&#x7C7B;&#x4F3C;&#x3002;&#x4E0B;&#x9762;&#x662F;&#x6709;&#x4E00;&#x4E2A;&#x540D;&#x4E3A; <a href="https://logback.qos.ch/xref/chapters/migrationFromLog4j/TrivialLog4jAppender.html" target="_blank">TrivialLog4jAppender</a> &#x7684;&#x7B80;&#x5355; appender&#xFF0C;&#x5B83;&#x4F1A;&#x5728;&#x63A7;&#x5236;&#x53F0;&#x8F93;&#x51FA;&#x7531;&#x5B83;&#x7684; layout &#x8FD4;&#x56DE;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> chapters.migrationFromLog4j;

<span class="hljs-keyword">import</span> org.apache.log4j.AppenderSkeleton;
<span class="hljs-keyword">import</span> org.apache.log4j.spi.LoggingEvent;


<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TrivialLog4jAppender</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AppenderSkeleton</span> </span>{

  <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">append</span><span class="hljs-params">(LoggingEvent loggingevent)</span> </span>{
    String s = <span class="hljs-keyword">this</span>.layout.format(loggingevent);
    System.out.println(s);
  }

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">close</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-comment">// nothing to do</span>
  }

  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">requiresLayout</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
  }
}
</code></pre>
<p>&#x5728; logback-classic &#x4E2D;&#x7B49;&#x4EF7;&#x7684;&#x5199;&#x6CD5;&#x4E3A; <a href="https://logback.qos.ch/xref/chapters/migrationFromLog4j/TrivialLogbackAppender.html" target="_blank">TrivialLogbackAppender</a>&#xFF0C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">package</span> chapters.migrationFromLog4j;

<span class="hljs-keyword">import</span> ch.qos.logback.classic.spi.ILoggingEvent;
<span class="hljs-keyword">import</span> ch.qos.logback.core.AppenderBase;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TrivialLogbackAppender</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">AppenderBase</span>&lt;<span class="hljs-title">ILoggingEvent</span>&gt; </span>{

  <span class="hljs-meta">@Override</span>
  <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">start</span><span class="hljs-params">()</span> </span>{
    <span class="hljs-keyword">if</span> (<span class="hljs-keyword">this</span>.layout == <span class="hljs-keyword">null</span>) {
      addError(<span class="hljs-string">&quot;No layout set for the appender named [&quot;</span> + name + <span class="hljs-string">&quot;].&quot;</span>);
      <span class="hljs-keyword">return</span>;
    }
    <span class="hljs-keyword">super</span>.start();
  }

  <span class="hljs-meta">@Override</span>
  <span class="hljs-function"><span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title">append</span><span class="hljs-params">(ILoggingEvent loggingevent)</span> </span>{
    <span class="hljs-comment">// AppenderBase.doAppend &#x53EA;&#x4F1A;&#x5728;&#x8FD9;&#x4E2A; appender &#x6210;&#x529F;&#x542F;&#x52A8;&#x4E4B;&#x540E;&#x8C03;&#x7528;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;</span>
    String s = <span class="hljs-keyword">this</span>.layout.doLayout(loggingevent);
    System.out.println(s);
  }
}
</code></pre>
<p>&#x6BD4;&#x8F83;&#x8FD9;&#x4E24;&#x4E2A;&#x7C7B;&#xFF0C;&#x4F60;&#x4F1A;&#x53D1;&#x73B0; <code>append()</code> &#x65B9;&#x6CD5;&#x7684;&#x5185;&#x5BB9;&#x6CA1;&#x6709;&#x6539;&#x53D8;&#x3002;<code>requiresLayout</code> &#x65B9;&#x6CD5;&#x5728; logback &#x4E2D;&#x6CA1;&#x6709;&#x7528;&#x5230;&#xFF0C;&#x6240;&#x4EE5;&#x5B83;&#x53EF;&#x4EE5;&#x88AB;&#x79FB;&#x9664;&#x3002;&#x5728; logback &#x4E2D;&#xFF0C;<code>stop()</code> &#x65B9;&#x6CD5;&#x4E0E; log4j &#x4E2D;&#x7684; <code>close()</code> &#x65B9;&#x6CD5;&#x7B49;&#x4EF7;&#x3002;&#x7136;&#x800C;&#xFF0C;logback-classic &#x4E2D;&#x7684; <code>AppenderBase</code> &#x5305;&#x542B;&#x4E00;&#x4E2A;&#x6CA1;&#x6709;&#x5B9E;&#x73B0;&#x7684; <code>stop</code> &#x65B9;&#x6CD5;&#xFF0C;&#x4F46;&#x662F;&#x5728;&#x8FD9;&#x4E2A;&#x7B80;&#x5355;&#x7684; appender &#x5DF2;&#x7ECF;&#x8DB3;&#x591F;&#x4E86;&#x3002;</p>



                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="12第十二章Groovy配置.html" class="navigation navigation-prev " aria-label="Previous page: 第十二章：Groovy 配置">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="14第十四章Receivers.html" class="navigation navigation-next " aria-label="Next page: 第十四章：Receivers">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第十三章：从 log4j 迁移","level":"1.14","depth":1,"next":{"title":"第十四章：Receivers","level":"1.15","depth":1,"path":"14第十四章Receivers.md","ref":"14第十四章Receivers.md","articles":[]},"previous":{"title":"第十二章：Groovy 配置","level":"1.13","depth":1,"path":"12第十二章Groovy配置.md","ref":"12第十二章Groovy配置.md","articles":[]},"dir":"ltr"},"config":{"plugins":["add-js-css","myseo"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"add-js-css":{"js":["./lib/site.js"]},"myseo":{"description":"logback中文网包含了logback中文文档，最新资讯，应用案例等。logback 继承自 log4j，它建立在有十年工业经验的日志系统之上。它比其它所有的日志系统更快并且更小，包含了许多独特并且有用的特性。","keywords":"logback中文文档, logback api文档, logback log4j,springboot logback,logback日志类型","titlePrefix":"logback中文网|"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","keywords":"","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"logback中文手册","gitbook":"*","description":""},"file":{"path":"13第十三章从log4j迁移.md","mtime":"2019-02-23T10:29:29.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-02-24T03:19:05.191Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-add-js-css/fda70cfc36440304bb976a11f47eb151-site.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

